<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page import="cn._2dland.bots.jdo.AccountManager"%>
<%@page import="cn._2dland.bots.jdo.models.Account"%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="/style/common.css">
<link rel="stylesheet" type="text/css" href="/style/style.css">
<script language="javascript" src="/js/jquery-1.4.2.min.js"></script>
<script language="javascript">
function register() {
	var acctId = $(':hidden[name=acctid]').val();
	var user = $(':text[name=username]').val();
	var pass = $(':password[name=password]').val();
	var status = $('select[name=status]').val();
	$.post('/manager',{action:2,acctid:acctId,password:pass,status:status},handler);
}
function handler(data){
	alert(data);
}
</script>
<title>U115机器人</title>
</head>
<body>
<%
AccountManager am = new AccountManager();
try {
	String acctIdStr = request.getParameter("acctid");
	if(acctIdStr == null || !acctIdStr.matches("^\\d+$")) {
%>
非法帐户ID参数！
<%
	} else {
		Account a = am.getAccount(Long.valueOf(acctIdStr));
%>
<table>
	<tr><td>email</td><td><input type="text" name="username" value="<%=a.getUsername()%>"></td></tr>
	<tr><td>密码</td><td><input type="password" name="password" value="<%=a.getPassword()%>"></td></tr>
	<tr><td>状态</td><td><select name="status"><option value="0">正常</option><option value="1">停用</option></select></td></tr>
	<tr><td></td><td align="right"><input type="button" value="修改" onclick="register();"></td></tr>
</table>
<input type="hidden" name="acctid" value="<%=acctIdStr%>">
<%
	}
} finally {
	am.close();
}
%>
</body>
</html>